package edu.psu.geovista.app.plot.axis;

import javax.swing.*;

/**
 * Created by IntelliJ IDEA.
 * User: jinchen
 * Date: Jun 27, 2003
 * Time: 6:02:26 PM
 * To change this template use Options | File Templates.
 */
public class YAxisUI extends BasicAxisUI{
    public YAxisUI(BasicAxis axis) {
        super(axis);
    }
    public void installUI(JComponent c)   {
        this.axis=(BasicAxis)c;
        this.axisStateMonitor=new ChangeHandler();
        //you decide what kind of ruler here. A ruler, acting as a strategy, provide paint algorithmn

        /*  U can setRuler() instead of doing below
        if (axis instanceof YAxis){
            Ruler ruler=new ColorRuler( Ruler.VERTICAL,axis.getActiveSize(), axis.getAxisLocation() ,axis.getTickRange() );
            //axis.setRuler();
        }
        else if(axis instanceof XAxis){
            ruler=new ColorRuler( Ruler.HORIZONTAL ,axis.getActiveSize(), axis.getAxisLocation() ,axis.getTickRange() );
        }*/
        this.updateRuler() ;//initial ruler
        //This basicUI won't install any listeners
        installListeners( axis);
    }

    /* public void paint( Graphics g, JComponent c )   {
        edu.psu.geovista.app.plot.ruler.Ruler ruler=this.getRuler() ;
        if (ruler!=null) {
            //this.updateRuler() ;
            ruler.paintComponent(g);
        }
         YAxis yAxis = (YAxis) axis;
         if(yAxis.isShowFilterTick()) {
                paintShowRangeTick(g);
         }

    }*/

}
